class TencentUtils{
  static bool isTextNotEmpty(String? text){
    return text != null && text.isNotEmpty;
  }

  static String? checkString(String? text){
    return (text != null && text.isEmpty) ? null : text;
  }

  /// final children = [Text('1'), Text('2'), Text('3')];
  /// children.joinElement(Divider());
  /// children 内的元素为 [Text('1'), Divider(), Text('2'), Divider(), Text('3')]
  static List<T> joined<T>(Iterable<T> list, T Function() separator) {
    final target = <T>[];
    for (var element in list) {
      target.addAll([element, separator()]);
    }
    if (target.isNotEmpty) target.removeLast();
    return target;
  }
}